package com.mocha.bss.org.api.fallback;


import com.mocha.bss.org.api.MochaUserFeign;
import com.mocha.bss.org.dto.UserDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MochaUserFeignFallback implements FallbackFactory<MochaUserFeign> {
    @Override
    public MochaUserFeign create(Throwable cause) {
        return new MochaUserFeign(){
            @Override
            public boolean testFacade(UserDTO userPo) {
                log.error("MochaUserFeign testFacade Throwable: {}", cause.getMessage());
                return false;
            }
        };
    }


}
